package com.gc.server.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class UserScore {

    @ExcelProperty("名字")
    private String name;

    @ExcelProperty("编号")
    private String code;

    @ExcelProperty("总分")
    private BigDecimal score;

    @ExcelProperty("图片分")
    private BigDecimal imgScore;

    @ExcelIgnore
    private String province;

    @ExcelIgnore
    private String city;

    public void addScore(BigDecimal score,BigDecimal imgScore){
        if(score!=null){
            this.score = this.score.add(score);
        }
       if(imgScore!=null){
           this.imgScore = this.score.add(imgScore);
       }
    }


    public UserScore(String name, String code, BigDecimal score, BigDecimal imgScore, String province, String city) {
        this.name = name;
        this.code = code;
        this.score = score;
        this.imgScore = imgScore;
        this.province = province;
        this.city = city;
    }
}
